package com.yeren.service.impl;

import java.util.List;

import com.yeren.dao.UserDao;
import com.yeren.dao.impl.UserDaoImpl;
import com.yeren.entity.User;
import com.yeren.service.UserService;
import com.yeren.utils.PageBean;



/**
 * liubiao
 */
public class UserServiceImpl implements UserService{
	UserDao udao=new UserDaoImpl();
	
	public int save(User user) {
		int save = udao.save(user);
		return save;
	}

	public int delete(int userId) {
		int delete = udao.delete(userId);
		return delete;
	}

	public int update(User user) {
		int update = udao.update(user);
		return update;
	}

	public User findById(int userId) {
		User user = udao.findById(userId);
		return user;
	}

	public List<User> findAll(User user,PageBean pb) {
		List<User> findAll = udao.findAll(user, pb);
		return findAll;
	}

	public boolean isExitAccount(String account) {
		boolean exitAccount = udao.isExitAccount(account);
		return exitAccount;
	}

	public int modifyPassword(User user) {
		int modifyPassword = udao.modifyPassword(user);
		return modifyPassword;
	}

	public User login(User user) {
		User loginUser = udao.login(user);
		return loginUser;
	}

	public int getSum() {
		int sum = udao.getSum();
		return sum;
	}

}
